import { ApiProperty, IntersectionType, PartialType } from '@nestjs/swagger'
import { IsNumber, IsString } from 'class-validator'
import { PagerDto } from '~/common/dto/pager.dto'

export class GoodDto {
  @ApiProperty({ description: '任务名称' })
  @IsString()
  name: string

  @ApiProperty({ description: '商品描述' })
  @IsString()
  description: string

  @ApiProperty({ description: '商品图片' })
  @IsString()
  image: string

  @ApiProperty({ description: '商品价格' })
  @IsNumber()
  price: number

  @ApiProperty({ description: '商品颜色' })

  @IsString()
  color: string

  @ApiProperty({ description: '商品尺寸' })
  @IsString()
  size: string
}

export class GoodQueryDto extends IntersectionType(PagerDto, PartialType(GoodDto)) {
}

export class GoodUpdateDto extends PartialType(GoodDto) {
}
